package com.hc.feign;

import com.hc.pojo.Meber;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "APP-HWX-MEMBER",fallbackFactory = IMemberFeignFallbackFactory.class)
public interface IMemberFeign {


    @RequestMapping("/getMenberById")
    public  String getMenberById(@RequestParam Integer id);

    @RequestMapping("/addMeber")
    public  void addMeber(@RequestBody Meber meber);

    /**
     * 服务熔断演示方法
     * @param id
     * @return
     */
    @RequestMapping("/getMenberById2")
    public  Meber getMenberById2(@RequestParam Integer id);


    @RequestMapping("/getMenberList")
    public List<Meber> getMenberList();
}
